package com.mall.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mall.entity.MmallOrderItem;
import com.mall.entity.MmallShipping;
import com.mall.service.MmallShippingService;
import com.mall.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ppmall
 * @since 2021-09-19
 */
@CrossOrigin
@RestController
@RequestMapping("/mall/shipping")
public class MmallShippingController {

    @Autowired
    private MmallShippingService shippingService;

    @GetMapping("/shipping")
    public R getShippingById(Integer id) {
        MmallShipping shipping = shippingService.getById(id);
        return shipping != null ? R.ok().data("shipping", shipping) : R.error().message("查不到该数据");
    }
}

